import Vue from 'vue'
import VueRouter from 'vue-router'

// import login from '../components//login/login'
// import Home from '../components/Home'
// import Welcome from '../components/Welcome'//欢迎页
// import Foundation from '../components/Foundation'//基础表格
// import Options from '../components/Options'//tab选项卡
// import BasicForm from '../components/Formrelated/BasicForm'//基本表单
// import RichTextEditor from '../components/Formrelated/Three-levelmenu/RichTextEditor'//富文本编辑器
// import markdown from '../components/Formrelated/Three-levelmenu/markdown'//markdown编辑器
// import Fileupload from '../components/Formrelated/Fileupload'//文件上传
// import Customicon from '../components/Customicon'//自定义图标
// import Schartchart from '../components/Schartchart'//schart图表
// import DragTheList from '../components/DragTheComponent/DragTheList'//拖拽列表
// import DragBulletFrame from '../components/DragTheComponent/DragBulletFrame'//拖拽弹框
// import internationalization from '../components/internationalization'//国际化功能
// import Permission from '../components/ErrorHandling/Permission'//权限测试
// import Abnormal from '../components/ErrorHandling/Abnormal'//404页面
// import Support from '../components/Support'//支持作者

// import add from '../page/add'//数据添加
// import Revise from '../page/Revise'//数据修改


// import { component } from 'vue/types/umd'
// import { compile, component } from 'vue/types/umd'
// import { resolve } from 'core-js/fn/promise'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    // component: login,
    component: () => import('@/components//login/login')
  },
  // {
  //   path: '/',
  //   name: 'Home',
  //   // component: Home,
  //   component: () => import('@/components/Home'),
  //   // redirect: '/Welcome',
  //   redirect: '/Welcome',
  //   children:[
  //     {
  //       path:'/Welcome',//欢迎页
  //       // component:Welcome
  //       component: () => import('@/components/Welcome')
  //     },
  //     {
  //       path:'/Foundation',//基础表格
  //       // component:Foundation
  //       component: () => import('@/components/Foundation')
  //     },
  //     {
  //       path:'/Options',//tab选项卡
  //       // component:Options
  //       component: ()=> import('@/components/Options')
  //     },
  //     {
  //       path:'/BasicForm',//基本表单
  //       // component:BasicForm,
  //       component: () => import('@/components/Formrelated/BasicForm')
  //     },
  //       {
  //         path:'/add',//数据添加页
  //         // component:add
  //         component: () => import('@/page/add')
  //       },
  //       {

  //         path:'/Revise/:index',//数据修改页
  //         // component:Revise
  //         component: () => import('@/page/Revise')
       
  //       },
  //     {
  //       path:'/RichTextEditor',//富文本编辑器
  //       // component:RichTextEditor
  //       component: () => import('@/components/Formrelated/Three-levelmenu/RichTextEditor')
  //     },
  //     {
  //       path:'/markdown',//markdown编辑器
  //       // component:markdown
  //       component: () => import('@/components/Formrelated/Three-levelmenu/markdown')
  //     },
  //     {
  //       path:'/Fileupload',//文件上传
  //       // component:Fileupload
  //       component: ()=> import('@/components/Formrelated/Fileupload')
  //     },
  //     {
  //       path:'/Customicon',//自定义图标
  //       // component:Customicon
  //       component: ()=> import('@/components/Customicon')
  //     },
  //     {
  //       path:'/Schartchart',//schart图表
  //       // component:Schartchart
  //       component: () => import('@/components/Schartchart')
  //     },
  //     {
  //       path:'/DragTheList',//拖拽列表
  //       // component:DragTheList
  //       component: ()=> import('@/components/DragTheComponent/DragTheList')
  //     },
  //     {
  //       path:'/DragBulletFrame',//拖拽弹框
  //       // component:DragBulletFrame
  //       component: ()=> import('@/components/DragTheComponent/DragBulletFrame')
  //     },
  //     {
  //       path:'/internationalization',//国际化功能
  //       // component:internationalization
  //       component: ()=> import('@/components/internationalization')
  //     },
  //     {
  //       path:'/Permission',//权限测试
  //       // component:Permission
  //       component: ()=> import('@/components/ErrorHandling/Permission')
  //     },
  //     {
  //       path:'/Abnormal',//404页面
  //       // component:Abnormal
  //       component: ()=> import("@/components/ErrorHandling/Abnormal")
  //     },
  //     {
  //       path:'/Support',//支持作者
  //       // component:Support
  //       component: ()=> import('@/components/Support')
  //     }
  //   ]
  // }
 
]
//路由守卫
// routes.beforeEach((to, from, next) => {
//   let userInfo = sessionStorage.getItem('vuelogin');		//获取登录存储的数据
//   if (to.path === '/') {		//如果当前进入页面是登录或注册就不执行任何操作，继续进入。
//       next();
//   } else {//否则判断是否存在登录存储的数据，不存在就进入登录页面
//       if (userInfo === null) {
//           next('/');
//       } else {
//           next();
//       }
//   }
// });

const router = new VueRouter({
  routes
})

export default router